package com.pgeg.listener;

import com.pgeg.ModMain;
import com.pgeg.config.Configuration;
import com.pgeg.config.ModConfig;
import com.pgeg.registry.*;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;

import static com.pgeg.util.Reference.MODID;

public class RegistryListener {

    public static void registerAll() {
        if (ModConfig.showLogo) {
            ModMain.getLogger().info("\n" + "\n" +
                            " _____   _____   _____   _____  \n" +
                            " _____   _____   _____   _____  \n" +
                            "|  _  \\ /  ___| | ____| /  ___| \n" +
                            "| |_| | | |     | |__   | |     \n" +
                            "|  ___/ | |  _  |  __|  | |  _  \n" +
                            "| |     | |_| | | |___  | |_| | \n" +
                            "|_|     \\_____/ |_____| \\_____/ \n");
        }
        ModMain.getLogger().info("---Welcome to play PGEG mod---");
        ItemRegistry.registerItem();
        ArmorRegistry.registerArmor();
        BlockRegistry.registerBlock();
        CropRegistry.registerCrop();
        EnchantmentRegistry.registerEnchantment();
        FoodRegistry.registerFood();
        ToolRegistry.registerTools();
        WeaponsRegistry.registerWeapon();
        StatusEffectRegistry.registerStatusEffect();
        WorldGenRegistry.registerWorldGen();
        LootTableRegistry.registerLootTable();
        EntityRegistry.registerEntity();
        new Configuration(ModConfig.class, MODID);
    }

    @Environment(EnvType.CLIENT)
    public static void registerClientAll() {
        ClientRegistry.registerClient();
    }

}